package com.gyp.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gyp.entity.GyPayPackage;
import com.gyp.mapper.user.GyPayPackageMapper;
import com.gyp.model.PageHandler;
import com.gyp.model.common.PageInfo;
import com.gyp.model.common.Search;
import com.gyp.service.GyPayPackageService;
import org.springframework.stereotype.Service;

@Service
public class GyPayPackageServiceImpl extends ServiceImpl<GyPayPackageMapper, GyPayPackage> implements GyPayPackageService  {
    @Override
    public PageInfo<GyPayPackage> selectPayPackages(Search search) {
        Page<GyPayPackage> page = lambdaQuery()
                .orderByDesc(GyPayPackage::getCreateTime)
                .page(new Page<>(search.getPageNum(), search.getPageNum()));
        return PageHandler.returnPage(page.getRecords(),search,page.getTotal());
    }
}
